<?php
/**
 * @ClassName: OrderEvaluate
 * @Description: 订单评价
 * @author: wyaohu
 * @Date: 2024-09-08 22:06
 * @Version: V1.0.0
 */

namespace app\common\model;

use app\common\model\store\Store;
use think\Model;
use think\model\concern\SoftDelete;

class OrderEvaluate extends Model
{
    use SoftDelete;

    protected $name = 'order_evaluate';

    protected $autoWriteTimestamp = 'dateTime';

    public static $scoring_table = [
        1 => '1分',
        2 => '2分',
        3 => '3分',
        4 => '4分',
        5 => '5分',
    ];

    public static $scoring_criteria = [
        5 => '好评',
        3 => '中评',
        1 => '差评',
    ];

    public function goods()
    {
        return $this->belongsTo(ShopGoods::class, 'goods_id', 'id');
    }

    public function member()
    {
        return $this->belongsTo(Member::class, 'member_id', 'id');
    }

    public function store()
    {
        return $this->belongsTo(Store::class, 'store_id', 'id');
    }

    public function order()
    {
        return $this->belongsTo(ShopOrder::class, 'order_id', 'id');
    }

}